home *** CD-ROM | disk | FTP | other *** search
/ PCMania 30 / PCMania CD30.iso / premiere / premiere.mst < prev    next >
Text File  |  1994-05-02  |  22KB  |  729 lines

  1. '*
  2. '*            Adobe Premiere Installer
  3. '*
  4. '* June 5, 1993  Marshall Spight
  5. '*
  6. '*
  7. '*
  8. '*
  9. '*
  10.  
  11. '$DEFINE DEBUG  ''Define for script development/debugging
  12.  
  13. '$INCLUDE 'setupapi.inc'
  14. '$INCLUDE 'msdetect.inc'
  15.  
  16.  
  17.  
  18. ''following were taken from windows.h. &H means they're hex
  19. CONST WS_VISIBLE=&H10000000
  20. CONST WS_BORDER =&H00800000
  21. CONST WS_CLIPCHILDREN =&H02000000
  22. CONST GWL_STYLE =-16
  23. CONST SW_SHOWMAXIMIZED=3
  24. CONST EW_RESTARTWINDOWS=&H00000042
  25.  
  26.  
  27. DECLARE FUNCTION ShowWindow  LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  28. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
  29. DECLARE FUNCTION ExitWindows  LIB "User" (Flag&, Param%) AS INTEGER
  30. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  31.  
  32. '' Ask for serial number?
  33. CONST AskSernum       = 0
  34.  
  35. ''Dialog ID's
  36. CONST ASKQUIT      = 100
  37. CONST DESTPATH     = 200
  38. CONST EXITFAILURE  = 300
  39. CONST EXITQUIT     = 400
  40. CONST EXITSUCCESS  = 500
  41. CONST OPTIONS      = 600
  42. CONST APPHELP      = 700
  43. CONST CUSTINST     = 800
  44. CONST TOOBIG       = 900
  45. CONST BADPATH      = 1000
  46. CONST RESTART      = 2600
  47. CONST RESTARTII    = 2700
  48.  
  49. CONST PERSONALIZE  = 10000
  50.  
  51. CONST PERLICENSE   = 20000
  52.  
  53.  
  54. ''Bitmap ID
  55. CONST LOGO         = 1
  56.  
  57. ''File Types
  58.  
  59. CONST PROGRAMFILES   = 1
  60. CONST MSVIDEOFILES   = 2
  61. CONST QUICKTIMEFILES = 3
  62. CONST TUTORIALFILES  = 4
  63.  
  64. CONST    NUMGROUPS      = 5    '' Number of file groups: PROGRAM to TUTORIAL
  65.  
  66.  
  67. GLOBAL DEST$        ''Default destination directory.
  68. GLOBAL WINDRIVE$    ''Windows drive letter.
  69. GLOBAL ENOUGHDISK%
  70.  
  71.  
  72. ''CustInst list symbol names
  73.  
  74. GLOBAL PROGRAMNEEDS$
  75. GLOBAL MSVIDEONEEDS$
  76. GLOBAL QUICKTIMENEEDS$
  77. GLOBAL TUTORIALNEEDS$
  78.  
  79. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  80. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  81.  
  82. ''Dialog list symbol names
  83. GLOBAL CHECKSTATES$
  84. GLOBAL STATUSTEXT$
  85. GLOBAL DRIVETEXT$
  86.  
  87.  
  88. DECLARE SUB AddOptFilesToCopyList (ftype%)
  89. DECLARE SUB RecalcOptFiles (ftype%)
  90. DECLARE SUB RecalcPath
  91. DECLARE SUB SetDriveStatus
  92. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  93. DECLARE SUB X1 LIB "mscuistf.dll" (arg$)
  94. DECLARE SUB X2 LIB "mscuistf.dll" (arg$)
  95. DECLARE SUB X3 LIB "mscuistf.dll" (arg$)
  96. DECLARE SUB FixScreenProc LIB "mscuistf.dll" (arg%)
  97. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  98.  
  99.  
  100.  
  101.  
  102. INIT:
  103.     ENOUGHDISK% = 1
  104.  
  105.     hWnd%=HwndFrame()
  106.     FixScreenProc ( hWnd% )
  107.     SWLxx&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  108.     SWyy%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
  109.  
  110.     INSTALLDLL$ = "mscuistf.dll"        ''custom functions
  111.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  112.  
  113.     SetBitmap INSTALLDLL$, LOGO
  114.     SetTitle "Adobe Premiere Installer"
  115.  
  116.     MajorVer% = GetWindowsMajorVersion()
  117.     MinorVer% = GetWindowsMinorVersion()
  118.  
  119.     IF  MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  120.     i% = DoMsgBox("Adobe Premiere requires Microsoft Windows version 3.10 or greater.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  121.         END
  122.     END IF
  123.  
  124.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  125.     IF szInf$ = "" THEN
  126.         szInf$ = GetSymbolValue("STF_CWDDIR") + "PREMIERE.INF"
  127.     END IF
  128.     ReadInfFile szInf$
  129.  
  130.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  131.     IF AskSerNum = 1 THEN
  132.     DEST$ = GetIniKeyString( GetWindowsDir() + "premiere.ini", "Premiere", "PremiereDirectory" )
  133.     IF IsDirWritable(DEST$) = 0 THEN
  134.          DEST$ = WINDRIVE$ + ":\PREMIERE"
  135.     END IF
  136.     END IF
  137.  
  138.     IF DEST$ = "" THEN
  139.     IF AskSerNum = 1 THEN
  140.          DEST$ = WINDRIVE$ + ":\PREMIERE"
  141.     ELSE
  142.          DEST$ = WINDRIVE$ + ":\TRYOUT\PREMIERE"
  143.     END IF
  144.     END IF
  145.     IF MID$( DEST, LEN(DEST), 1 ) = "\" THEN
  146.        DEST$ = MID$( DEST, 1, LEN( DEST ) - 1 )
  147.     END IF
  148.  
  149.     ''CustInst list symbols
  150.     CHECKSTATES$ = "CheckItemsState"
  151.     STATUSTEXT$  = "StatusItemsText"
  152.     DRIVETEXT$   = "DriveStatusText"
  153.     FOR i% = 1 TO NUMGROUPS STEP 1
  154.         AddListItem CHECKSTATES$, "ON"
  155.     NEXT i%
  156.     FOR i% = 1 TO NUMGROUPS STEP 1
  157.         AddListItem STATUSTEXT$, ""
  158.     NEXT i%
  159.     FOR i% = 1 TO 7 STEP 1
  160.         AddListItem DRIVETEXT$, ""
  161.     NEXT i%
  162.     ReplaceListItem DRIVETEXT$, 7, DEST$
  163.  
  164.     ''Disk cost list symbols
  165.  
  166.     PROGRAMNEEDS$   = "ProgramNeeds"
  167.     MSVIDEONEEDS$   = "MSVideoNeeds"
  168.     QUICKTIMENEEDS$ = "QuickTimeNeeds"
  169.     TUTORIALNEEDS$  = "TutorialNeeds"
  170.  
  171.     EXTRACOSTS$ = "ExtraCosts"
  172.     BIGLIST$    = "BigList"
  173.  
  174.     FOR i% = 1 TO NUMGROUPS STEP 1
  175.         AddListItem BIGLIST$, ""
  176.     NEXT i%
  177.     FOR i% = 1 TO 26 STEP 1
  178.         AddListItem EXTRACOSTS$, "0"
  179.     NEXT i%
  180.  
  181.     RecalcPath
  182.     SetDriveStatus
  183.  
  184. '$IFDEF DEBUG
  185.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  186. '$ENDIF ''DEBUG
  187.  
  188.  
  189.  
  190. CUSTINST:
  191.     sz$ = UIStartDlg(INSTALLDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  192.  
  193.     IF sz$ = "CONTINUE" THEN
  194.         ''Install only if it will fit.
  195.           IF ENOUGHDISK% = 0 THEN
  196.                  GOSUB TOOBIG
  197.                  GOTO CUSTINST
  198.           END IF
  199.         UIPop 1
  200.         GOTO INSTALL
  201.     ELSEIF sz$ = "PATH" THEN
  202.         GOTO GETPATH
  203.     ELSEIF sz$ = "CHK1" THEN
  204.         RecalcOptFiles PROGRAMFILES
  205.         SetDriveStatus
  206.         GOTO CUSTINST
  207.     ELSEIF sz$ = "CHK2" THEN
  208.         RecalcOptFiles MSVIDEOFILES
  209.         SetDriveStatus
  210.         GOTO CUSTINST
  211.     ELSEIF sz$ = "CHK3" THEN
  212.         RecalcOptFiles QUICKTIMEFILES
  213.         SetDriveStatus
  214.         GOTO CUSTINST
  215.     ELSEIF sz$ = "CHK4" THEN
  216.         RecalcOptFiles TUTORIALFILES
  217.         SetDriveStatus
  218.         GOTO CUSTINST
  219.     ELSEIF sz$ = "REACTIVATE" THEN
  220.         RecalcPath
  221.         SetDriveStatus
  222.         GOTO CUSTINST
  223.     ELSE
  224.         GOSUB ASKQUIT
  225.         GOTO CUSTINST
  226.     END IF
  227.  
  228.  
  229.  
  230. INSTALL:
  231.  
  232.  
  233.     IF (GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON") THEN
  234.         IF AskSerNum = 1 THEN
  235.             sz$ = UIStartDlg(INSTALLDLL$, PERSONALIZE, "dlgPERinstall", 0, "" )
  236.             IF sz$ <> "VALID" THEN
  237.                 sz$ = UIStartDlg(INSTALLDLL$, EXITQUIT, "FInfo0DlgProc", 0, "")
  238.                 UIPop 1
  239.                 END
  240.             END IF
  241.         ELSE
  242.             sz$ = UIStartDlg(INSTALLDLL$, PERLICENSE, "dlgPERLicense", 0, "" )
  243.             IF sz$ <> "AGREE" THEN
  244.                 sz$ = UIStartDlg(INSTALLDLL$, EXITQUIT, "FInfo0DlgProc", 0, "")
  245.                 UIPop 1
  246.                 END
  247.             ENDIF
  248.         END IF
  249.     END IF
  250.  
  251.     CopyFile GetWindowsDir() + "win.ini", GetWindowsDir() + "win.prm", cmoOverwrite, 0
  252.     CopyFile GetWindowsDir() + "system.ini", GetWindowsDir() + "system.prm", cmoOverwrite, 0
  253.     CreateDir DEST$, cmoNone
  254.  
  255.     IF GetListItem( CHECKSTATES$, PROGRAMFILES ) = "ON" THEN
  256.         CreateDir DEST$ + "\PLUGINS", cmoNone
  257.         CreateDir DEST$ + "\4_PSHOP", cmoNone
  258.         CreateDir DEST$ + "\DRIVERS", cmoNone
  259.     END IF
  260.  
  261.     IF GetListItem( CHECKSTATES$, TUTORIALFILES ) = "ON" THEN
  262.         CreateDir DEST$ + "\SAMPLES", cmoNone
  263.     END IF
  264.  
  265.     WinDir$ = GetWindowsDir()
  266.     WinSysDir$ = GetWindowsSysDir()
  267.  
  268.     ClearCopyList
  269.     AddOptFilesToCopyList PROGRAMFILES
  270.     AddOptFilesToCopyList MSVIDEOFILES
  271.     AddOptFilesToCopyList QUICKTIMEFILES
  272.     AddOptFilesToCopyList TUTORIALFILES
  273.     SetRestartDir WinDir$
  274.     CopyFilesInCopyList
  275.  
  276.     IF GetListItem( CHECKSTATES$, MSVIDEOFILES ) = "ON" THEN
  277.         ''Updating WIN.INI and SYSTEM.INI
  278.  
  279.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  280.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "msrle.drv", cmoOverwrite
  281.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  282.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite
  283.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite
  284.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite
  285.         CreateIniKeyValue "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  286.         CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  287.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  288.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  289.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  290.         CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  291.         CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  292.         CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  293.         IF VflatdPresent() = 0 THEN
  294.             CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  295.         END IF
  296.         Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  297.         Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  298.         Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  299.  
  300.     END IF
  301.  
  302.  
  303.     ''IF GetListItem( CHECKSTATES$, QUICKTIMEFILES ) = "ON" THEN
  304.         ''CreateIniKeyValue "win.ini", "Extensions", "mov", "mplayer.exe /play /close ^.mov", cmoNone
  305.         ''CreateIniKeyValue "win.ini", "mci extensions", "mov", "QTWVideo", cmoOverwrite
  306.         ''CreateIniKeyValue GetWindowsDir() + "system.ini", "mci", "QTWVideo", "mciqtw.drv", cmoOverwrite
  307.     ''END IF
  308.  
  309.     IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  310.           CreateIniKeyValue "WIN.INI", "Extensions", "PPJ", DEST$ + "\PREMIERE.EXE ^.PPJ", cmoOverwrite
  311.           CreateIniKeyValue "WIN.INI", "Extensions", "PSQ", DEST$ + "\PREMIERE.EXE ^.PSQ", cmoOverwrite
  312.           CreateIniKeyValue "WIN.INI", "Extensions", "PLB", DEST$ + "\PREMIERE.EXE ^.PLB", cmoOverwrite
  313.  
  314.         RemoveFile GetWindowsDir() + "premiere.prf", cmoForce
  315.  
  316.         CreateProgmanGroup "Adobe", "", cmoNone
  317.         ShowProgmanGroup  "Adobe", 1, cmoNone
  318.     IF AskSerNum = 1 THEN
  319.             CreateProgmanItem "Adobe", "Premiere 1.1", MakePath( DEST$, "premiere.exe" ), "", cmoOverwrite
  320.     ELSE
  321.             CreateProgmanItem "Adobe", "Premiere 1.1 Tryout", MakePath( DEST$, "premiere.exe" ), "", cmoOverwrite
  322.     END IF
  323.         CreateProgmanItem "Adobe", "Premiere ReadMe", "write.exe " + MakePath( DEST$, "prreadme.wri" ), "", cmoOverwrite
  324.         ''CreateProgmanItem "Adobe", "QuickTime ReadMe", "write.exe " + MakePath( GetWindowsSysDir(), "qtreadme.wri" ), "", cmoOverwrite
  325.     IF AskSernum = 1 THEN
  326.         X$ = "                                        "
  327.         X1 ( X$ )
  328.         R$ = CHR$( LEN( X$ ) ) + X$
  329.         X$ = "                                        "
  330.         X2 ( X$ )
  331.         R$ = R$ + CHR$( LEN( X$ ) ) + X$
  332.         X$ = "                                        "
  333.         X3 ( X$ )
  334.         R$ = R$ + CHR$( LEN( X$ ) ) + X$
  335.         StampResource "ProgramFiles", "1", DEST$, 6, 65, R$, LEN( R$ )
  336.     END IF
  337.  
  338.     IF DoesFileExist( GetWindowsDir() + "photoshp.ini", femRead ) <> 0 THEN
  339.         PHOTOSHOPPLUGINSDIR$ = GetIniKeyString( GetWindowsDir() + "photoshp.ini", "Photoshop", "PLUGINDIRECTORY" )
  340.         IF PHOTOSHOPPLUGINSDIR$ <> "" THEN
  341.             CopyFile DEST$ + "\4_PSHOP\FILMST8B.8BI", PHOTOSHOPPLUGINSDIR$ + "\FILMST8B.8BI", cmoNone, 0
  342.         END IF
  343.     END IF
  344.  
  345. END IF
  346.  
  347.  
  348.  
  349.  
  350. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows
  351. '' automatically; else, it gives the user the choice
  352.     RESTRT% = RestartListEmpty ()
  353.     Exe$ = WinDir$ + "\_msrstrt.exe"
  354.     Batch$ = WinDir$ + "\_mssetup.bat"
  355.     empty$ = ""
  356. RESTART:
  357.     IF RESTRT% = 0 THEN
  358.         sz$ = UIStartDlg(INSTALLDLL$, RESTART, "FInfo0DlgProc", 0, "")
  359.         IF sz$ = "REACTIVATE" THEN
  360.              GOTO RESTART
  361.         ENDIF
  362.         I% = ExitExecRestart ()
  363.         RemoveFile Exe$, cmoForce
  364.         RemoveFile Batch$, cmoForce
  365.         END
  366.     ELSE
  367.         sz$ = UIStartDlg(INSTALLDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  368.         IF sz$ = "CONTINUE" THEN
  369.             I% = ExitWindowsExec (Exe$, empty$)
  370.             IF I% = 0 THEN
  371.                 GOTO RESTART
  372.             ELSE
  373.             END
  374.         ENDIF
  375.         ELSEIF sz$ = "EXIT" THEN
  376.             UIPopAll
  377.             END
  378.         ELSEIF sz$ = "REACTIVATE" THEN
  379.             GOTO RESTART
  380.         ELSE
  381.             UIPop 1
  382.         END IF
  383.     END IF
  384.  
  385.  
  386.  
  387. QUIT:
  388.     ON ERROR GOTO ERRQUIT
  389.  
  390.     IF ERR = 0 THEN
  391.         dlg% = EXITSUCCESS
  392.     ELSEIF ERR = STFQUIT THEN
  393.         dlg% = EXITQUIT
  394.     ELSE
  395.         dlg% = EXITFAILURE
  396.     END IF
  397. QUITL1:
  398.     sz$ = UIStartDlg(INSTALLDLL$, dlg%, "FInfo0DlgProc", 0, "")
  399.     IF sz$ = "REACTIVATE" THEN
  400.         GOTO QUITL1
  401.     END IF
  402.     UIPop 1
  403.  
  404.     END
  405.  
  406. ERRQUIT:
  407.     i% = DoMsgBox("Setup sources were corrupted!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  408.     END
  409.  
  410.  
  411.  
  412. GETPATH:
  413.     SetSymbolValue "EditTextIn", DEST$
  414.     SetSymbolValue "EditFocus", "ALL"
  415. GETPATHL1:
  416.     sz$ = UIStartDlg(INSTALLDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  417.  
  418.     IF sz$ = "CONTINUE" THEN
  419.         olddest$ = DEST$
  420.         DEST$ = GetSymbolValue("EditTextOut")
  421.  
  422.         ''Validate new path.
  423.         IF LEN( DEST ) < 4 THEN
  424.             GOSUB BADPATH
  425.             GOTO GETPATHL1
  426.         END IF
  427.  
  428. ''        IF MID$( DEST, 1, 1 ) = "A" THEN
  429. ''            GOSUB BADPATH
  430. ''            GOTO GETPATHL1
  431. ''        END IF
  432.  
  433. ''        IF MID$( DEST, 1, 1 ) = "B" THEN
  434. ''            GOSUB BADPATH
  435. ''            GOTO GETPATHL1
  436. ''        END IF
  437.  
  438.         IF IsDirWritable(DEST$) = 0 THEN
  439.             GOSUB BADPATH
  440.             GOTO GETPATHL1
  441.         END IF
  442.  
  443.           IF MID$( DEST, LEN(DEST), 1 ) = "\" THEN
  444.               DEST$ = MID$( DEST, 1, LEN( DEST ) - 1 )
  445.           END IF
  446.  
  447.         UIPop 1
  448.  
  449.         ''Truncate display if too long.
  450.         IF LEN(DEST$) > 23 THEN
  451.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  452.         ELSE
  453.             ReplaceListItem DRIVETEXT$, 7, DEST$
  454.         END IF
  455.  
  456.         ''Recalc if path changed.
  457.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  458.             RecalcPath
  459.             SetDriveStatus
  460.         END IF
  461.  
  462.         olddest$ = ""
  463.         GOTO CUSTINST
  464.     ELSEIF sz$ = "REACTIVATE" THEN
  465.         RecalcPath
  466.         SetDriveStatus
  467.         GOTO GETPATHL1
  468.     ELSEIF sz$ = "EXIT" THEN
  469.         GOSUB ASKQUIT
  470.         GOTO GETPATHL1
  471.     ELSE
  472.         UIPop 1
  473.         GOTO CUSTINST
  474.     END IF
  475.  
  476.  
  477.  
  478. TOOBIG:
  479.     sz$ = UIStartDlg(INSTALLDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  480.     IF sz$ = "REACTIVATE" THEN
  481.         RecalcPath
  482.         SetDriveStatus
  483.         GOTO TOOBIG
  484.     END IF
  485.     UIPop 1
  486.     RETURN
  487.  
  488.  
  489.  
  490. BADPATH:
  491.     sz$ = UIStartDlg(INSTALLDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  492.     IF sz$ = "REACTIVATE" THEN
  493.         RecalcPath
  494.         SetDriveStatus
  495.         GOTO BADPATH
  496.     END IF
  497.     UIPop 1
  498.     RETURN
  499.  
  500.  
  501.  
  502. ASKQUIT:
  503.     sz$ = UIStartDlg(INSTALLDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  504.  
  505.     IF sz$ = "EXIT" THEN
  506.         UIPopAll
  507.         ERROR STFQUIT
  508.     ELSEIF sz$ = "REACTIVATE" THEN
  509.         GOTO ASKQUIT
  510.     ELSE
  511.         UIPop 1
  512.     END IF
  513.     RETURN
  514.  
  515.  
  516.  
  517. '**
  518. '** Purpose:
  519. '**     Adds the specified option files to the copy list.
  520. '** Arguments:
  521. '**     ftype%  - type of files to add, one of the following:
  522. '**             PROGRAMFILES, TUTORIALFILES ...
  523. '** Returns:
  524. '**     none.
  525. '*************************************************************************
  526. SUB AddOptFilesToCopyList (ftype%) STATIC
  527.  
  528.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  529.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  530.         IF ftype% = PROGRAMFILES THEN
  531.             AddSectionFilesToCopyList "ProgramFiles", SrcDir$, DEST$
  532.             AddSectionFilesToCopyList "PluginFiles", SrcDir$, DEST$ + "\plugins"
  533.             AddSectionFilesToCopyList "ProgramWinFiles", SrcDir$, GetWindowsDir()
  534.             AddSectionFilesToCopyList "ProgramWinSysFiles", SrcDir$, GetWindowsSysDir()
  535.             AddSectionFilesToCopyList "PhotoshopFiles", SrcDir$, DEST$ + "\4_pshop"
  536.             AddSectionFilesToCopyList "DriversFiles", SrcDir$, DEST$ + "\drivers"
  537.         ELSEIF ftype% = MSVIDEOFILES THEN
  538.             AddSectionFilesToCopyList "MSVideoFiles", SrcDir$, GetWindowsDir()
  539.             AddSectionFilesToCopyList "MSVideoSysFiles", SrcDir$, GetWindowsSysDir()
  540.         ELSEIF ftype% = QUICKTIMEFILES THEN
  541.             AddSectionFilesToCopyList "QuickTimeFiles", SrcDir$, DEST$
  542.         ELSEIF ftype% = TUTORIALFILES THEN
  543.             AddSectionFilesToCopyList "TutorialFiles", SrcDir$, DEST$ + "\samples"
  544.         END IF
  545.         SrcDir$ = ""
  546.     END IF
  547. END SUB
  548.  
  549.  
  550. '**
  551. '** Purpose:
  552. '**     Recalculates disk space for the given option files and sets
  553. '**     the status info symbol "StatusItemsText".
  554. '** Arguments:
  555. '**     ftype% - type of files to add, one of the following:
  556. '**             PROGRAMFILES, PLUGINFILES...
  557. '** Returns:
  558. '**     none.
  559. '*************************************************************************
  560. SUB RecalcOptFiles (ftype%) STATIC
  561.     CursorSave% = ShowWaitCursor()
  562.     ClearCopyList
  563.     AddOptFilesToCopyList ftype%
  564.  
  565.     fExtra% = 0
  566.     ndrive% = 1
  567.     idrive% = 1
  568.     IF ftype% = PROGRAMFILES THEN
  569.         ListSym$ = PROGRAMNEEDS$
  570.         IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  571.             ''Add extra cost to Windows drive for ini/progman, etc.
  572.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  573.             ReplaceListItem EXTRACOSTS$, ndrive%, "20000"
  574.             idrive% = ASC(ucase$(DEST$)) - ASC("A") + 1
  575.             ReplaceListItem EXTRACOSTS$, idrive%, "200000"
  576.             fExtra% = 1
  577.         END IF
  578.     ELSEIF ftype% = MSVIDEOFILES THEN
  579.         ListSym$ = MSVIDEONEEDS$
  580.         IF GetListItem(CHECKSTATES$, MSVIDEOFILES) = "ON" THEN
  581.             ''Add extra cost to Windows drive for ini/progman, etc.
  582.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  583.             ReplaceListItem EXTRACOSTS$, ndrive%, "20000"
  584.             fExtra% = 1
  585.         END IF
  586.     ELSEIF ftype% = QUICKTIMEFILES THEN
  587.         ListSym$ = QUICKTIMENEEDS$
  588.         IF GetListItem(CHECKSTATES$, QUICKTIMEFILES) = "ON" THEN
  589.             ''Add extra cost to Windows drive for ini/progman, etc.
  590.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  591.             ReplaceListItem EXTRACOSTS$, ndrive%, "20000"
  592.             fExtra% = 1
  593.         END IF
  594.     ELSEIF ftype% = TUTORIALFILES THEN
  595.         ListSym$ = TUTORIALNEEDS$
  596.         IF GetListItem(CHECKSTATES$, TUTORIALFILES) = "ON" THEN
  597.             ''Add extra cost to Windows drive for ini/progman, etc.
  598.             idrive% = ASC(ucase$(DEST$)) - ASC("A") + 1
  599.             ReplaceListItem EXTRACOSTS$, idrive%, "60000"
  600.             fExtra% = 1
  601.         END IF
  602.     END IF
  603.  
  604.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  605.  
  606.     cost& = 0
  607.     FOR i% = 1 TO 26 STEP 1
  608.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  609.     NEXT i%
  610.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  611.  
  612.     IF StillNeed& > 0 THEN
  613.         ReplaceListItem BIGLIST$, ftype%, "YES"
  614.     ELSE
  615.         ReplaceListItem BIGLIST$, ftype%, ""
  616.     END IF
  617.  
  618.     IF fExtra% THEN
  619.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  620.         ReplaceListItem EXTRACOSTS$, idrive%, "0"
  621.     END IF
  622.     RestoreCursor CursorSave%
  623.     ListSym$ = ""
  624. END SUB
  625.  
  626.  
  627. '**
  628. '** Purpose:
  629. '**     Recalculates disk space and sets option status info according
  630. '**     to the current destination path.
  631. '** Arguments:
  632. '**     none.
  633. '** Returns:
  634. '**     none.
  635. '*************************************************************************
  636. SUB RecalcPath STATIC
  637.  
  638.     CursorSave% = ShowWaitCursor()
  639.  
  640.     RecalcOptFiles PROGRAMFILES
  641.     RecalcOptFiles MSVIDEOFILES
  642.     RecalcOptFiles QUICKTIMEFILES
  643.     RecalcOptFiles TUTORIALFILES
  644.  
  645.     RestoreCursor CursorSave%
  646. END SUB
  647.  
  648.  
  649. '**
  650. '** Purpose:
  651. '**     Sets drive status info according to latest disk space calcs.
  652. '** Arguments:
  653. '**     none.
  654. '** Returns:
  655. '**     none.
  656. '*************************************************************************
  657. SUB SetDriveStatus STATIC
  658.  
  659.     ENOUGHDISK% = 1
  660.  
  661.  
  662.     drive$ = MID$(DEST$, 1, 1)
  663.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  664.     cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  665.     cost& = cost& + VAL( GetListItem( MSVIDEONEEDS$, ndrive% ) )
  666.     cost& = cost& + VAL( GetListItem( QUICKTIMENEEDS$, ndrive% ) )
  667.     cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  668.     free& = GetFreeSpaceForDrive(drive$)
  669.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  670.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  671.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  672.  
  673.  
  674.     IF cost& > free& THEN
  675.           ENOUGHDISK% = 0
  676.     END IF
  677.  
  678.     IF drive$ = WINDRIVE$ THEN
  679.         ReplaceListItem DRIVETEXT$, 4, ""
  680.         ReplaceListItem DRIVETEXT$, 5, ""
  681.         ReplaceListItem DRIVETEXT$, 6, ""
  682.     ELSE
  683.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  684.         cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  685.         cost& = cost& + VAL( GetListItem( MSVIDEONEEDS$, ndrive% ) )
  686.         cost& = cost& + VAL( GetListItem( QUICKTIMENEEDS$, ndrive% ) )
  687.         cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  688.         IF cost& = 0 THEN
  689.             ReplaceListItem DRIVETEXT$, 4, ""
  690.             ReplaceListItem DRIVETEXT$, 5, ""
  691.             ReplaceListItem DRIVETEXT$, 6, ""
  692.         ELSE
  693.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  694.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  695.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  696.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  697.         END IF
  698.  
  699.         IF cost& > free& THEN
  700.               ENOUGHDISK% = 0
  701.         END IF
  702.  
  703.     END IF
  704. END SUB
  705.  
  706.  
  707. '**
  708. '** Purpose:
  709. '**     Appends a file name to the end of a directory path,
  710. '**     inserting a backslash character as needed.
  711. '** Arguments:
  712. '**     szDir$  - full directory path (with optional ending "\")
  713. '**     szFile$ - filename to append to directory
  714. '** Returns:
  715. '**     Resulting fully qualified path name.
  716. '*************************************************************************
  717. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  718.     IF szDir$ = "" THEN
  719.         MakePath = szFile$
  720.     ELSEIF szFile$ = "" THEN
  721.         MakePath = szDir$
  722.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  723.         MakePath = szDir$ + szFile$
  724.     ELSE
  725.         MakePath = szDir$ + "\" + szFile$
  726.     END IF
  727. END FUNCTION
  728.  
  729.